package com.xoa.controller.inv;


import com.xoa.model.inv.InvWarehouse;
import com.xoa.service.inv.InvWarehouseService;
import com.xoa.util.ToJson;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 张丽军 仓库管理
 */
@Controller
@RequestMapping("/invWarehouse")
public class InvWarehouseController {

    @Resource
    private InvWarehouseService invWarehouseService;

    //   仓库管理的页面
    @RequestMapping("/index")
    public String  index(HttpServletRequest request){
        return "app/storage/warehouse/index";
    }
    // 报表门户
    @RequestMapping("/reportingPortal")
    public String  reportingPortal(HttpServletRequest request){
        return "app/main/menu/reportingPortal";
    }

    //   库存管理-仓库管理的页面
    @RequestMapping("/warehoseindex")
    public String  warehoseindex(HttpServletRequest request){
        return "app/storage/inventoryManagement/warehouseManagement/index";
    }
    //  仓库管理的页面
    @RequestMapping("/commodityInventory")
    public String  commodityInventory(HttpServletRequest request){
        return "app/storage/inventoryManagement/inventoryView/commodityInventory";
    }
    //   仓库产品入库
    @RequestMapping("/productWarehouse")
    public String  productWarehouse(HttpServletRequest request){
        return "app/storage/warehouse/productWarehouse";
    }

    //  利润统计-商品利润
    @RequestMapping("/commodityProfit")
    public String  commodityProfit(HttpServletRequest request){
        return "app/storage/profitStatistics/commodityProfit";
    }
    //利润统计-客户利润
    @RequestMapping("/customerProfit")
    public String  customerProfit(HttpServletRequest request){
        return "app/storage/profitStatistics/customerProfit";
    }
    //利润统计-员工销售业绩
    @RequestMapping("/employeeSales")
    public String  employeeSales(HttpServletRequest request){
        return "app/storage/profitStatistics/employeeSales";
    }

    //利润统计-员工提成
    @RequestMapping("/employeeCommission")
    public String  employeeCommission(HttpServletRequest request){
        return "app/storage/profitStatistics/employeeCommission";
    }

    //利润统计-其他收支
    @RequestMapping("/expenditure")
    public String  expenditure(HttpServletRequest request){
        return "app/storage/profitStatistics/expenditure";
    }

    //销售统计
    @RequestMapping("/salesStatistics")
    public String  salesStatistics(HttpServletRequest request){
        return "app/storage/salesStatistics/index";
    }

    //收款单
    @RequestMapping("/collReceipt")
    public String  collReceipt(HttpServletRequest request){
        return "/app/storage/collection/collReceipt";
    }
    //付款单
    @RequestMapping("/fuReceipt")
    public String  fuReceipt(HttpServletRequest request){
        return "/app/storage/collection/fuReceipt";
    }
    //来往单位
    @RequestMapping("/addCustomerIds")
    public String collReceipts(HttpServletRequest request){
        return "/app/storage/collection/addCustomerIds";
    }
    //来往单位
    @RequestMapping("/addCustomerIdsd")
    public String collReceiptsd(HttpServletRequest request){
        return "/app/storage/collection/addCustomerIdsd";
    }

    /**
     * 新建仓库信息接口
     * @param request
     * @param invWarehouse
     * @return
     */
    @ResponseBody
    @RequestMapping("/insertInvHouse")
    public ToJson<InvWarehouse> insertInvHouse(HttpServletRequest request,InvWarehouse invWarehouse){
        return invWarehouseService.insertInvHouse(request,invWarehouse);
    }

    /**
     * 修改仓库信息接口
     * @param request
     * @param invWarehouse
     * @return
     */
    @ResponseBody
    @RequestMapping("/updateInvHouse")
    public ToJson<InvWarehouse> updateInvHouse(HttpServletRequest request,InvWarehouse invWarehouse){
        return invWarehouseService.updateInvHouse(request,invWarehouse);
    }

    /**
     * 查询仓库详情信息
     * @param request
     * @param warehouseId
     * @return
     */
    @ResponseBody
    @RequestMapping("/selectInvById")
    public ToJson<InvWarehouse> selectInvById(HttpServletRequest request,Integer warehouseId){
        return invWarehouseService.selectInvById(request,warehouseId);
    }

    /**
     * 删除仓库信息
     * @param request
     * @param warehouseId
     * @return
     */
    @ResponseBody
    @RequestMapping("/deleteInvById")
    public ToJson<InvWarehouse> deleteInvById(HttpServletRequest request,Integer warehouseId){
        return invWarehouseService.deleteInvById(request,warehouseId);
    }

    /**
     * 条件查询仓库信息
     * @param request
     * @param invWarehouse
     * @return
     */
    @ResponseBody
    @RequestMapping("/selectInvInfo")
    public ToJson<InvWarehouse> selectInvInfo(HttpServletRequest request,InvWarehouse invWarehouse){
        return invWarehouseService.selectInvInfo(request,invWarehouse);
    }




}
